<div id="stock-detail">
	<div id="basic" class="<?php if(1 == $stock['base']->del_flg){echo ' deleted';}?><?php if(1 == $stock['base']->balance_flg){echo ' balanced';} ?>">
		<div class="number"><?php echo $stock['base']->stock_number; ?></div>
		<div class="stock-date"><?php echo date('Y年m月d日', $stock['base']->stock_date); ?></div>
		<div class="person">操作人：<?php echo $stock['base']->stock_realname; ?></div>
		<div class="balance"><?php echo 0==$stock['base']->balance_flg?'未结算':'已结算'; ?></div>
		<div class="delete"><?php echo 0==$stock['base']->del_flg?'未撤销':'已撤销 撤销人：' . $stock['base']->del_realname; ?></div>
		<div class="clear"></div>
	</div>
	<div class="other">
		<div class="title">备注</div>
		<div class="description"><?php echo empty($stock['base']->description)?'无':$stock['base']->description; ?></div>
	</div>
	<div class="list">
		<div class="hd">
			<div class="item">货物信息</div>
			<div class="attribute">属性</div>
			<div class="bound">出入库</div>
			<div class="bound-type">类型</div>
			<div class="store">仓库</div>
			<div class="quantity">数量</div>
			<div class="price">单价</div>
		</div>
		<div class="content">
			<?php foreach ($stock['detail'] as $key=>$each) { ?>
			<div class="each">
				<div class="item">
					<div class="image"><img src="<?php echo $each['info']['taobao_info']['image'] ?>" /></div>
					<div class="numbers">
						<div class="number">货号<br /><?php echo $each['info']['number'] ?></div>
						<div class="search-code">厂家编码<br /><?php echo $each['info']['search_code'] ?></div>
						<div class="cost">总值 <span>-</span></div>
					</div>
				</div>
				<div class="detail">
					<?php foreach ($each['sub'] as $sub) { ?>
					<div class="each-sub">
						<div class="attribute"><?php echo $sub->attribute ?></div>
						<div class="bound"><?php echo $sub->stock_type ?></div>
						<div class="bound-type">
							<?php if (0==$sub->bound_type_id): ?>
							<?php echo '调货' ?>
							<?php elseif('inbound'==$sub->stock_type): ?>
							<?php echo $inbound_types[$sub->bound_type_id]['sys_name'] . '[' . $inbound_types[$sub->bound_type_id]['name']  . ']'; ?>
							<?php elseif ('outbound'==$sub->stock_type): ?>
							<?php echo $outbound_types[$sub->bound_type_id]['sys_name'] . '[' . $outbound_types[$sub->bound_type_id]['name']  . ']'; ?>
							<?php endif ?>
						</div>
						<div class="store"><?php echo $sub->store_id ?></div>
						<div class="quantity"><?php echo $sub->quantity ?></div>
						<div class="price"><?php echo $sub->price ?></div>
					</div>
					<?php } ?>
				</div>
				<div class="clear"></div>
			</div>
			<?php } ?>
			<?php //var_dump($stock['detail']); ?>
		</div>
	</div>
</div>

<script type="text/javascript">
$(function(){
	main.stock_retext();
	main.store_retext($('.store'));
	tool.set_fixed($('#basic'));
	style.highline($('.each'), '#eee');
	style.highline($('.each-sub'), '#ccc');
	stock.detail.init();
})
</script>